<?php

namespace App\Jobs;


use App\Libraries\Easemob\Easemob;
use App\Libraries\Tools\Msg;
use App\Models\HongBao\HongBao;
use App\Models\Msg\MsgSystem;
use Illuminate\Support\Facades\Log;

class RegisterJob extends Job
{


    private $user_id;


    public function __construct($user_id)
    {
        $this->user_id = $user_id;
    }

    /**
     * Execute the job.
     *
     * @return bool
     */
    public function handle()
    {
        Log::debug("CreateEasemobUserJob");
        //分发创建环信账号job
        dispatch(new AddIMFriends($this->user_id));

        Log::debug("SendWelcomeMsgJob");
        //分发发送欢迎消息job
        dispatch(new SendWelcomeMsgJob($this->user_id));

        Log::debug("AddRegisterHongBaoJob");
        //分发注册红包job
        dispatch(new AddRegisterHongBaoJob($this->user_id));

        Log::debug("GetMobileCityIdJob");
        //分发获取手机归属城市ID Job
        dispatch(new GetMobileCityIdJob($this->user_id));

        return true;
    }
}
